package com.ruoyi.system.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 *
 * @TableName facility
 */
@TableName(value ="facility")
@Data
public class Facility implements Serializable {
    /**
     * 设备id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 隔离人员id
     * */
    @TableField(value = "isolation_id")
    private Long isolationId;

    /**
     * 设备名称
     */
    @TableField(value = "name")
    private String name;

    /**
     * 服务器ip地址
     */
    @TableField(value = "server_ip")
    private String serverIp;

    /**
     * 设备类型
     */
    @TableField(value = "type")
    private String type;


    /**
     * 服务器ip端口
     */
    @TableField(value = "server_port")
    private String serverPort;

    /**
     * 热成像仪模块ip地址
     */
    @TableField(value = "module_ip")
    private String moduleIp;

    /**
     * 热成像仪端口号
     */
    @TableField(value = "module_port")
    private String modulePort;

    /**
     * 创建时间
     */
    @Excel(name = "创建时间", prompt = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)//创建与修改时自动填充
    private Date createTime;

    /**
     * 更新新时间
     */
    @Excel(name = "更新新时间", prompt = "更新新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)//创建与修改时自动填充
    private Date updateTime;

    /**
     * 逻辑删除
     */
    @TableField(value = "is_delete")
    private Integer isDelete;

    /**
     * 设备状态
     */
    @TableField(value = "status")
    private Integer status;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Facility other = (Facility) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getServerIp() == null ? other.getServerIp() == null : this.getServerIp().equals(other.getServerIp()))
            && (this.getServerPort() == null ? other.getServerPort() == null : this.getServerPort().equals(other.getServerPort()))
            && (this.getModuleIp() == null ? other.getModuleIp() == null : this.getModuleIp().equals(other.getModuleIp()))
            && (this.getModulePort() == null ? other.getModulePort() == null : this.getModulePort().equals(other.getModulePort()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getServerIp() == null) ? 0 : getServerIp().hashCode());
        result = prime * result + ((getServerPort() == null) ? 0 : getServerPort().hashCode());
        result = prime * result + ((getModuleIp() == null) ? 0 : getModuleIp().hashCode());
        result = prime * result + ((getModulePort() == null) ? 0 : getModulePort().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", serverIp=").append(serverIp);
        sb.append(", serverPort=").append(serverPort);
        sb.append(", moduleIp=").append(moduleIp);
        sb.append(", modulePort=").append(modulePort);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", isDelete=").append(isDelete);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
